Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add master referenced id/uri audio playlists. Add playlists to hls media groups #1124

Merged
merged 14 commits into from
May 14, 2021

Conversation

brandonocasey
Copy link
Contributor

@brandonocasey brandonocasey commented Apr 29, 2021

Fixes issues with rendition switching on audio only hls media.

src/playlist-loader.js Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Apr 29, 2021

Codecov Report

Merging #1124 (40a7ab9) into main (552b012) will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1124      +/-   ##
==========================================
+ Coverage   86.15%   86.19%   +0.04%     
==========================================
  Files          39       39              
  Lines        9254     9281      +27     
  Branches     2115     2126      +11     
==========================================
+ Hits         7973     8000      +27     
  Misses       1281     1281              
Impacted Files Coverage Δ
src/manifest.js 97.84% <100.00%> (+0.17%) ⬆️
src/media-groups.js 98.95% <100.00%> (+0.04%) ⬆️
src/playlist-loader.js 91.63% <100.00%> (+0.22%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 552b012...40a7ab9. Read the comment docs.

src/media-groups.js Show resolved Hide resolved
src/manifest.js Outdated
properties.playlists.forEach(function(p, i) {
const id = createPlaylistID(i, groupId);

p.uri = p.uri || id;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is p.uri expected to be the groupId (what used to be called phonyUri)?
Should uri continue to be set to groupId?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that we can have more than 1 playlist in a group the groupId alone would conflict

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonder how big of an issue this is, since, it's potentially breaking.

Copy link
Contributor Author

@brandonocasey brandonocasey May 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we could keep playlist at index 0 as groupId, and use all others as id, then deprecate using it like this. Ideally we would do away with array/uri/id object thing we have right now.

@brandonocasey brandonocasey force-pushed the fix/hls-dash-mg-ids branch from b59673d to a771af2 Compare May 12, 2021 16:15
src/playlist-loader.js Outdated Show resolved Hide resolved
src/playlist-loader.js Outdated Show resolved Hide resolved
src/manifest.js Outdated Show resolved Hide resolved
Comment on lines +266 to 268
if (!properties.playlists || !properties.playlists.length) {
properties.playlists = [Object.assign({}, properties)];
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may impact this check:

} else if (properties.playlists && sourceType === 'dash') {

Which looks for the existence of playlists.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this might be okay since it is looking for dash sourceType specifically here and those will always have playlists. It does change our notions around a bit though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If DASH always has playlists in this case, I wonder why I included that case at all back when.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe it didn't at the time this was added

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worth us putting a TODO on that other line just so we don't forget to look into it.

test/media-groups.test.js Show resolved Hide resolved
Copy link
Contributor

@gesinger gesinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Might be worth adding tests around addPropertiesToMaster for media group IDs.

Comment on lines +266 to 268
if (!properties.playlists || !properties.playlists.length) {
properties.playlists = [Object.assign({}, properties)];
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worth us putting a TODO on that other line just so we don't forget to look into it.

@brandonocasey brandonocasey merged commit 740d2ee into main May 14, 2021
@brandonocasey brandonocasey deleted the fix/hls-dash-mg-ids branch May 14, 2021 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants